package com.kugou.miniapp.test;


import java.util.Scanner;

public class Main1 {
    static char[] com_strs = new char[]{'a', 'b', 'c', 'x', 'y', 'z'};
    static int[] com_int = new int[]{0,0,0,0,0,0};
    static int ou_index = 0;
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        String s = in.nextLine();
        char[] s_arr = s.toCharArray();
        for (int i = 0; i < s_arr.length; i++) {
            //判断是否选中
            for (int j = 0; j < com_strs.length; j++) {
                if (s_arr[i] == com_strs[j]){//选中
                    com_int[j]++;
                    if (isOu(com_int)){
                        ou_index=i;
                        break;
                    }
                }
            }
        }
        System.out.println(ou_index+1);

    }//main end

    public static boolean isOu(int[] count_arr){
//        boolean ou = true;
        for (int i = 0; i < count_arr.length; i++) {
            if (count_arr[i]%2 != 0){
//                ou = false;
                return false;
            }
        }
        return true;
    }

}